#include "function_test.h"

#include "include/toolkit/file_kit.h"


CPPUNIT_TEST_SUITE_REGISTRATION( CFunctionTest );

void CFunctionTest::TestExtract()
{
	tString strName;

	strName = wel::ExtractFileName( T("filename.exe") );
	CPPUNIT_ASSERT( strName == T("filename") );

	strName = wel::ExtractFileName( T("filenameexe.") );
	CPPUNIT_ASSERT( strName == T("filenameexe") );

	strName = wel::ExtractFileName( T(".filenameexe") );
	CPPUNIT_ASSERT( strName.empty() );

	strName = wel::ExtractFileName( T("i will do better") );
	CPPUNIT_ASSERT( strName == T("i will do better") );
}

void CFunctionTest::TestCurrentDir()
{
	tString strCurrentDir;
	CPPUNIT_ASSERT( wel::GetCurrentDir(strCurrentDir) );
	CPPUNIT_ASSERT( wel::ChangeCurrentDir(T("..\\")) );
	CPPUNIT_ASSERT( wel::ChangeCurrentDir(strCurrentDir) );
}
